'use strict';
const db = uniCloud.database()
exports.main = async (event, context) => {
	try {
		const clinic_data = {
			clinic: event.data.clinic,
			addressProvince: event.data.addressProvince,
			addressCity: event.data.addressCity,
			addressCounty: event.data.addressCounty,
			address: event.data.address
		}
		
		// 修改诊所信息
		const res_clinic = await db.collection('rx-clinic').doc(event._id).update(clinic_data)
		
		//返回数据给客户端
		return { data: {}, code: 200, msg: 'ok.' }
	} catch (err) {
		console.log(err)
		return { data: {}, code: 201, msg: '服务端错误.' }
	}
};
